package com.foreknow.springboot.service.Impl;

import com.foreknow.springboot.mapper.DeliveryaddressMapper;
import com.foreknow.springboot.po.Deliveryaddress;
import com.foreknow.springboot.service.DeliveryaddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DeliveryaddressServiceImpl implements DeliveryaddressService {

    @Autowired
    private DeliveryaddressMapper deliveryaddressMapper;

    @Override
    public List<Deliveryaddress> listDeliveryAddressByUserId(String userId) {
        return deliveryaddressMapper.listDeliveryAddressByUserId(userId);
    }

    @Override
    public Deliveryaddress getDeliveryAddressById(Integer daId) {
        return deliveryaddressMapper.getDeliveryAddressById(daId);
    }

    @Override
    public int saveDeliveryAddress(String contactName, Integer contactSex, String contactTel, String address, String userId) {
        return deliveryaddressMapper.saveDeliveryAddress(contactName,contactSex,contactTel,address,userId);
    }

    @Override
    public int updateDeliveryAddress(Integer daId, String contactName, Integer contactSex, String contactTel, String address, String userId) {
        return deliveryaddressMapper.updateDeliveryAddress(daId,contactName,contactSex,contactTel,address,userId);
    }

    @Override
    public int removeDeliveryAddress(Integer daId) {
        return deliveryaddressMapper.removeDeliveryAddress(daId);
    }
}
